﻿@using DevExpress.Web.ASPxEditors
@using DevExpress.Web.Mvc.UI
@using Dogshow.Web.Controllers
@model int?
           
@Html.DevExpress().ComboBox(
                    s =>
                    {
                        s.Name = "IdMesta";
                        s.ControlStyle.CssClass = "editor";
                        s.Properties.ValueType = typeof (int);
                        s.Properties.ValueField = "Id";
                        s.Properties.TextField = "Naziv";
                        s.Properties.IncrementalFilteringMode = IncrementalFilteringMode.Contains;
                        s.Properties.Columns.Add("PostanskiBroj", "Poštanski broj");
                        s.Properties.Columns.Add("Naziv", "Naziv");
                        s.Properties.FilterMinLength = 2;
                        s.CallbackRouteValues = new {Controller = "Mesta", Action = "MestaComboPartial"};
                        s.Properties.EnableCallbackMode = true;
                        //s.Properties.DisplayFormatString = "{0} {1}";
                        s.ShowModelErrors = true;
                    }).BindList(MestaController.FiltrirajMesta, MestaController.FiltrirajMestoPoId).BindList(MestaController.VratiMestoPoId(Model)).Bind(Model).GetHtml()